home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / regkey10.zip / MAKEKEY.C < prev    next >
C/C++ Source or Header  |  1992-07-19  |  2KB  |  51 lines

  1. /* Program to generate registration key codes for use with the BP?.LIB
  2.  * registration key decoding algorithm. When compiled, this program should
  3.  * be linked with the BP?.LIB file, by adding the name of this program and
  4.  * the BP?.LIB file to a project / make file.
  5.  */
  6.  
  7.  
  8. #include "bp.h"
  9.  
  10. #include <stdio.h>
  11. #include <string.h>
  12.  
  13. main()
  14.    {
  15.    unsigned int security_code;
  16.    unsigned int security_verification;
  17.    char registration_string[201];
  18.    char registration_verification[201];
  19.  
  20.    printf("MAKEKEY 1.00 - (C) Copyright 1992, Brian Pirie. All Rights Reserved.\n\n");
  21.  
  22.    printf(" Please Enter Program's Unique Security Code : ");
  23.    scanf("%u",&security_code);
  24.    printf("                      Again For Verification : ");
  25.    scanf("%u",&security_verification);
  26.    fflush(stdin);
  27.    if(security_code!=security_verification)
  28.       {
  29.       printf("\nCodes do not match!\n");
  30.       return(1);
  31.       }
  32.  
  33.    printf("           Registration String (User's Name) : ");
  34.    gets((char *)®istration_string);
  35.    printf("                      Again For Verification : ");
  36.    gets((char *)®istration_verification);
  37.    if(strcmp(registration_string,registration_verification)!=0)
  38.       {
  39.       printf("\nStrings do not match!\n");
  40.       return(1);
  41.       }
  42.  
  43.    printf("\n---------------------------------------------------------------------------\n");
  44.    printf("GENERATED REGISTRATION KEY :\n\n");
  45.    printf("            Registration String : [%s]\n",registration_string);
  46.    printf("               Registration Key : [%lu]\n",bp(registration_string,security_code));
  47.    printf("---------------------------------------------------------------------------\n");
  48.  
  49.    return(0);
  50.    }
  51.